﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Collections;

namespace B2B.Controllers
{
    public class ProductController : AlibabaApplicationController
    {
        //
        // GET: /Product/

        public ActionResult ProductList(int id)
        {
            ViewBag.DanhMuc = id;
            Models.SP_DanhSachSanPham sp_DanhSachSanPham = new Models.SP_DanhSachSanPham();
            ArrayList lis_SP = sp_DanhSachSanPham.DanhSachSanPhamTheoDanhMuc(id);
            ViewData["listSP_TheoDM"] = lis_SP;
            int tongSP = sp_DanhSachSanPham.TongSoSanPham(id);
            ViewData["tongSP"] = tongSP;
            return View();
        }

        public ActionResult ProductDetail(int id)
        {            
            Models.SP_ChiTietSanPham chitietSP = new Models.SP_ChiTietSanPham();
            ViewData["chitietSP"] = chitietSP.chiTietSanPham(id);
            return View();
        }

        public ActionResult ProductPostBuyRequest()
        {
            return View();
        }

        public ActionResult ProductQuote()
        {
            return View();
        }

        public ActionResult ProductSend(int id, string tenSP, string email, string hoTen, string hinhAnh)
        {
            ViewData["maSP"] = id.ToString();
            ViewData["tenSP"] = tenSP;
            ViewData["email"] = email;
            ViewData["hoTen"] = hoTen;
            ViewData["hinhAnh"] = hinhAnh;
           
            return View();
        }
         [ValidateInput(false)]
         [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult SendEmailContact(string id, string maSP, Models.SP_ThemSendContact sp_SendContact)
        {
            string link = "/Product/ProductDetail/" + maSP;
            sp_SendContact.ThemSendEmailContact(sp_SendContact, id, link);
            return View("ProductPostBuyRequest");
        }

        public ActionResult ViewPage1()
        {
            return View();
        }

    }
}
